package com.yungu.swift.api.route.v1.common;

import com.alibaba.dubbo.config.annotation.Reference;
import com.yungu.swift.api.base.BaseApi;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.order.service.PayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api(value = "通用预支付确认接口", tags = "通用预支付确认接口")
public class CheckPay extends BaseApi {
    @Reference
    private PayService payService;

    @RequestMapping(value = "/api/v1/common/checkPay", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    @ApiOperation(value = "通用预支付确认接口", response = ResponseData.class, notes = "通用预支付确认接口")
    public ResponseData<Boolean> checkPay(
            @ApiParam(name = "appid", value = "APP标识", required = true) @RequestParam String appid,
            @ApiParam(name = "orderUuid", value = "订单号", required = true) @RequestParam String orderUuid) {
        return payService.checkPay(orderUuid);
    }
}
